package iotwisp.school.user.qo;

import iotwisp.base.cqrs.BaseQO;
import iotwisp.base.orm.query.QueryCondition;
import iotwisp.base.orm.query.QueryConditionType;
import iotwisp.base.orm.query.QueryConfig;
import iotwisp.school.user.entity.User;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.List;

@SuppressWarnings("serial")
@Data
@EqualsAndHashCode(callSuper = false)
@QueryConfig(daoBeanId = "userService")
public class UserQO extends BaseQO<String> {

    @QueryCondition(name = "name", ifTrueUseLike = "nameLike")
    private String name;

    private Boolean nameLike = false;

    @QueryCondition(name = "mobile", ifTrueUseLike = "mobileLike")
    private String mobile;

    private Boolean mobileLike = false;

    @QueryCondition(name = "roles", type = QueryConditionType.FETCH_EAGER)
    private Boolean fetchRoles = false;

    @QueryCondition(name = "headImage", type = QueryConditionType.FETCH_EAGER)
    private Boolean fetchHeadImage;

    @QueryCondition(name = "regDate", type = QueryConditionType.BETWEEN)
    private List<Date> betweenRegDate;

}